package com.song.storm_demo.chap_03;

import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.topology.TopologyBuilder;

public class ExclamationTopology {
	
	
	
	public static void main(String[] args) {
		
		TopologyBuilder builder =new TopologyBuilder();
		
		builder.setSpout("words",new TestWordSpout(), 10);
		
		builder.setBolt("exclaim1", new ExclamationBolt(), 3).shuffleGrouping("words");
		builder.setBolt("exclaim2", new ExclamationBolt(), 2).shuffleGrouping("exclaim1");
		builder.setBolt("exclaim3", new ExclamationReader(), 2).shuffleGrouping("exclaim2");
		Config conf = new Config();
		conf.setDebug(false);
		LocalCluster cluster  =new LocalCluster();
		cluster.submitTopology("exclaim", conf, builder.createTopology());
	}
}
